package com.wondersgroup.fjzlpt.org.controller.rest.zdgl;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.wondersgroup.fjzlpt.org.util.ControllerCommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.quick.framework.boot.web.utils.RequestUtils;
import com.wondersgroup.fjzlpt.org.service.inter.zdgl.ZdglService;
import com.wondersgroup.fjzlpt.org.service.inter.zy.ZyService;

@RestController
@RequestMapping("zdgl")
public class ZdglRestController {

	@Autowired
	private ZdglService zdglService;
	
	@Autowired
	private ZyService zyService;
	
	@RequestMapping("/queryPage")
	public JSONObject queryPage(HttpServletRequest request) {
		Map<String, String> map = RequestUtils.GetParameterMap(request);
		ControllerCommonUtil.pageFormat(map);
		return zdglService.queryPage(map);
	}
	
	/*@RequestMapping("save")
	public JSONObject save(HttpServletRequest request){
		Map<String, String> map = RequestUtils.GetParameterMap(request);
		return zdglService.save(map);
	}*/
	
	@RequestMapping("insert")
	public JSONObject insert(HttpServletRequest request){
		Map<String, String> map = RequestUtils.GetParameterMap(request);
		return zdglService.insert(map);
	}
	
	@RequestMapping("delete")
	public JSONObject delete(HttpServletRequest request){
		Map<String, String> map = RequestUtils.GetParameterMap(request);
		return zdglService.delete(map);
	}
	
	@RequestMapping("queryTable")
	public JSONArray queryTable(HttpServletRequest request){
		Map<String, String> map = RequestUtils.GetParameterMap(request);
		return  zyService.queryTable(map);
	}
	
	@RequestMapping("queryPageTable")
	public JSONObject queryPageTable(HttpServletRequest request){
		Map<String, String> map = RequestUtils.GetParameterMap(request);
		return  zyService.queryPageTable(map);
	}
	
	@RequestMapping("deleteOne")
	public JSONObject deleteOne(HttpServletRequest request){
		Map<String, String> map = RequestUtils.GetParameterMap(request);
		return  zyService.delete(map);
	}
	
	@RequestMapping("insertOne")
	public JSONObject insertOne(HttpServletRequest request){
		Map<String, String> map = RequestUtils.GetParameterMap(request);
		return  zyService.insert(map);
	}
	
	@RequestMapping("updateOne")
	public JSONObject updateOne(HttpServletRequest request){
		Map<String, String> map = RequestUtils.GetParameterMap(request);
		return  zyService.update(map);
	}
}
